<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Scatter-Loading description file \&lt;device\&gt;_ac&lt;5|6&gt;.sct</title>
<title>CMSIS-Core (Cortex-M): Scatter-Loading description file \&lt;device\&gt;_ac&lt;5|6&gt;.sct</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="cmsis.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="printComponentTabs.js"></script>
<script type="text/javascript" src="cmsis_footer.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 46px;">
  <td id="projectlogo"><img alt="Logo" src="CMSIS_Logo_Final.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">CMSIS-Core (Cortex-M)
   &#160;<span id="projectnumber">Version 5.6.0</span>
   </div>
   <div id="projectbrief">CMSIS-Core support for Cortex-M processor-based devices</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<div id="CMSISnav" class="tabs1">
    <ul class="tablist">
      <script type="text/javascript">
		<!--
		writeComponentTabs.call(this);
		//-->
      </script>
	  </ul>
</div>
<!-- Generated by Doxygen 1.8.6 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="pages.html"><span>Usage&#160;and&#160;Description</span></a></li>
      <li><a href="modules.html"><span>Reference</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('linker_sct_pg.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">Scatter-Loading description file &lt;device&gt;_ac&lt;5|6&gt;.sct </div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>A scatter file for linking is required when using a <a class="el" href="startup_c_pg.html">C startup file</a>.</p>
<p>The <a class="el" href="linker_sct_pg.html">Scatter-Loading description file &lt;device&gt;_ac&lt;5|6&gt;.sct</a> contains regions for:</p>
<ul>
<li>Code (read-only data, execute-only data)</li>
<li>RAM (read/write data, zero-initialized data)</li>
<li>Stack</li>
<li>Heap</li>
<li>Stack seal (Armv8-M/v8.1-M)</li>
<li>CMSE veneer (Armv8-M/v8.1-M)</li>
</ul>
<p>Within the scatter file, the user needs to specify a set of macros. The scatter file is passed through the C preprocessor which uses these macros to calculate the start address and the size of the different regions.</p>
<div class="fragment"><div class="line"><span class="comment">/*--------------------- Flash Configuration ----------------------------------</span></div>
<div class="line"><span class="comment">; &lt;h&gt; Flash Configuration</span></div>
<div class="line"><span class="comment">;   &lt;o0&gt; Flash Base Address &lt;0x0-0xFFFFFFFF:8&gt;</span></div>
<div class="line"><span class="comment">;   &lt;o1&gt; Flash Size (in Bytes) &lt;0x0-0xFFFFFFFF:8&gt;</span></div>
<div class="line"><span class="comment">; &lt;/h&gt;</span></div>
<div class="line"><span class="comment"> *----------------------------------------------------------------------------*/</span></div>
<div class="line"><span class="preprocessor">#define __ROM_BASE      0x00000000</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#define __ROM_SIZE      0x00080000</span></div>
<div class="line"><span class="preprocessor"></span></div>
<div class="line"><span class="comment">/*--------------------- Embedded RAM Configuration ---------------------------</span></div>
<div class="line"><span class="comment">; &lt;h&gt; RAM Configuration</span></div>
<div class="line"><span class="comment">;   &lt;o0&gt; RAM Base Address    &lt;0x0-0xFFFFFFFF:8&gt;</span></div>
<div class="line"><span class="comment">;   &lt;o1&gt; RAM Size (in Bytes) &lt;0x0-0xFFFFFFFF:8&gt;</span></div>
<div class="line"><span class="comment">; &lt;/h&gt;</span></div>
<div class="line"><span class="comment"> *----------------------------------------------------------------------------*/</span></div>
<div class="line"><span class="preprocessor">#define __RAM_BASE      0x20000000</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#define __RAM_SIZE      0x00040000</span></div>
<div class="line"><span class="preprocessor"></span></div>
<div class="line"><span class="comment">/*--------------------- Stack / Heap Configuration ---------------------------</span></div>
<div class="line"><span class="comment">; &lt;h&gt; Stack / Heap Configuration</span></div>
<div class="line"><span class="comment">;   &lt;o0&gt; Stack Size (in Bytes) &lt;0x0-0xFFFFFFFF:8&gt;</span></div>
<div class="line"><span class="comment">;   &lt;o1&gt; Heap Size (in Bytes) &lt;0x0-0xFFFFFFFF:8&gt;</span></div>
<div class="line"><span class="comment">; &lt;/h&gt;</span></div>
<div class="line"><span class="comment"> *----------------------------------------------------------------------------*/</span></div>
<div class="line"><span class="preprocessor">#define __STACK_SIZE    0x00000200</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#define __HEAP_SIZE     0x00000C00</span></div>
<div class="line"><span class="preprocessor"></span></div>
<div class="line"><span class="comment">/*--------------------- CMSE Veneer Configuration ---------------------------</span></div>
<div class="line"><span class="comment">; &lt;h&gt; CMSE Veneer Configuration</span></div>
<div class="line"><span class="comment">;   &lt;o0&gt;  CMSE Veneer Size (in Bytes) &lt;0x0-0xFFFFFFFF:32&gt;</span></div>
<div class="line"><span class="comment">; &lt;/h&gt;</span></div>
<div class="line"><span class="comment"> *----------------------------------------------------------------------------*/</span></div>
<div class="line"><span class="preprocessor">#define __CMSEVENEER_SIZE    0x200</span></div>
</div><!-- fragment --><dl class="section note"><dt>Note</dt><dd>The stack is placed at the end of the available RAM and is growing downwards whereas the Heap is placed after the application data and growing upwards.</dd></dl>
<h1><a class="anchor" id="linker_sct_preproc_sec"></a>
Preprocessor command</h1>
<p>The scatter file uses different preprocessor commands for Arm Compiler V6 and Arm Compiler V5</p>
<ul>
<li><b>AC6:</b> #! armclang -E &ndash;target=arm-arm-none-eabi -mcpu=&lt;mcpu&gt; -xc</li>
<li><b>AC5:</b> #! armcc -E </li>
</ul>
</div></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="templates_pg.html">CMSIS-Core Device Templates</a></li>
    <li class="footer">
      <script type="text/javascript">
        <!--
        writeFooter.call(this);
        //-->
      </script>    
    </li>
  </ul>
</div>
</body>
</html>
